﻿<UserControl x:Class="DaphneControls.EngineConfiguration"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"                                    
             mc:Ignorable="d" 
             xmlns:local="clr-namespace:DaphneControls"
             
             d:DesignHeight="200" d:DesignWidth="400">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="2*" />            
        </Grid.ColumnDefinitions>
        
        <!-- Engine Type Controls -->
        <Grid Grid.Column="0" VerticalAlignment="Stretch">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="*" />                
            </Grid.RowDefinitions>            
            <Label Grid.Row="0" Content="{loc:Translate Default='Engine Type:'}"/>
            <ListBox x:Name="uxEngineTypes" Grid.Row="1"  VerticalAlignment="Stretch" 
                     ItemsSource="{Binding Path=EngineTypes}" SelectedValue="{Binding Path=SelectedEngineType}" />
        </Grid>
        
        <!-- Panel for specific configuration of selected engine type -->
        <ScrollViewer Grid.Column="1"  VerticalAlignment="Top" VerticalScrollBarVisibility="Visible">
            <local:InternalEngineSettings  DataContext="{Binding Path=InternalEngineVM}">
                <local:InternalEngineSettings.Style>
                    <Style TargetType="UserControl">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding ElementName=uxEngineTypes, Path=SelectedValue.Key}" Value="1">
                                <Setter Property="Visibility" Value="Collapsed" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </local:InternalEngineSettings.Style>
            </local:InternalEngineSettings>
        </ScrollViewer>

    </Grid>
</UserControl>
